<template>
  <el-pagination
    background
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="currentPage3"
    :page-size="pageSize"
    layout="prev, pager, next, jumper"
    :total="total">
  </el-pagination>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 1
    },
    currentPage3: {
      type: Number,
      default: 1
    },
    currpage: {
      type: Number,
      default: 1
    },
    total: {
      type: Number,
      default: 1
    },
    pageSize: {
      type: Number,
      default: 1
    }
  },
  watch: {
    //监听页数变化
    currentPage3(val, index) {
      if (typeof val === "number") {
        this.currentPage3 = val;
      }
    },
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('handleSizeChange' , val)
    },
    handleCurrentChange(val) {
      this.$emit('handleCurrentChange' , val)
    },
  }
}
</script>

<style scoped>
.el-pagination{
  text-align: center;
  margin-top: 36px;
}
</style>
